package mk.company.fin.utils;

import javax.swing.JLabel;
import javax.swing.SwingConstants;

import mk.company.fin.AppConstants;

/**
 * Utility class.
 * 
 * @author vlado.gjorgjiev
 */
public class AppUtils {
	
	private AppUtils() {
		// utility class
	}
	
	public static String renderAsHtml(String text, boolean createParagraph) {
		StringBuffer result = new StringBuffer();
		result.append(AppConstants.HTML.HTML_START);
		if (createParagraph) {
			result.append(AppConstants.HTML.PARAGRAPH_START);
		}
		result.append(text);
		if (createParagraph) {
			result.append(AppConstants.HTML.PARAGRAPH_END);
		}
		result.append(AppConstants.HTML.HTML_END);
		return result.toString();
	}
	
	public static void setStandardAlignmentAndPosition(JLabel label) {
//		label.setHorizontalAlignment(SwingConstants.LEFT);
		label.setHorizontalTextPosition(SwingConstants.CENTER);
//		label.setVerticalAlignment(SwingConstants.CENTER);
		label.setVerticalTextPosition(SwingConstants.CENTER);
	}
	
}
